package im.engure.common.registery;

import java.util.HashMap;
import java.util.Map;

/**
 * “本地服务注册信息”，JVM级别
 * <p/>
 * 存储结构
 * =========
 * {
 * interfaceName1: interfaceImplClass1,
 * interfaceName2: interfaceImplClass2,
 * }
 */
public class LocalServiceRegistry {

    private static final Map<String, Class<?>> m = new HashMap<String, Class<?>>();

    public static void registerService(String interfaceName, Class<?> clazz) {
        m.put(interfaceName, clazz);
    }

    public static Class<?> getServiceImpl(String interfaceName) {
        return m.get(interfaceName);
    }

}
